home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dragon-runner.swf / scripts / BirdChar.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  3.8 KB  |  151 lines

  1. package
  2. {
  3.    import flash.display.MovieClip;
  4.    import flash.events.Event;
  5.    
  6.    public class BirdChar extends MovieClip
  7.    {
  8.        
  9.       
  10.       private var ┬º\x01\x01\x02\t┬º:* = null;
  11.       
  12.       internal const OBTHEIGHT:* = 70;
  13.       
  14.       internal const ARMORDAMAGE:* = 5;
  15.       
  16.       private var ┬º\x01\x01\x06\r┬º:* = null;
  17.       
  18.       private var ┬º\x01\x01\t\x0e┬º:* = null;
  19.       
  20.       private var ┬º\x01\x01\t\x0f┬º:*;
  21.       
  22.       internal const OBTWIDTH:* = 160;
  23.       
  24.       private var ┬º\x01\x01\t\x10┬º:Boolean = true;
  25.       
  26.       private var ┬º\x01\x01\n\x01┬º:Boolean;
  27.       
  28.       internal const OBTYPOS:* = 175;
  29.       
  30.       internal const HEALTHDAMAGE:* = 15;
  31.       
  32.       private var ┬º\x01\x01\x07\x03┬º:* = 15;
  33.       
  34.       public function BirdChar()
  35.       {
  36.          ┬º\x01\x01\x02\t┬º = null;
  37.          ┬º\x01\x01\x06\r┬º = null;
  38.          ┬º\x01\x01\t\x0e┬º = null;
  39.          ┬º\x01\x01\x07\x03┬º = 15;
  40.          ┬º\x01\x01\t\x10┬º = true;
  41.          super();
  42.       }
  43.       
  44.       public function GetCharType() : String
  45.       {
  46.          return "bird";
  47.       }
  48.       
  49.       public function Init(param1:*, param2:*, param3:*) : *
  50.       {
  51.          ┬º\x01\x01\x06\r┬º = param2;
  52.          ┬º\x01\x01\x02\t┬º = param1;
  53.          ┬º\x01\x01\t\x0f┬º = param3;
  54.          ┬º\x01\x01\t\x10┬º = true;
  55.          ┬º\x01\x01\n\x01┬º = true;
  56.          ┬º\x01\x01\t\x0e┬º = param3.theKnight;
  57.          this.width = OBTWIDTH;
  58.          this.height = OBTHEIGHT;
  59.          this.y = OBTYPOS;
  60.          ┬º\x01\x01\x02\t┬º.addEventListener(Event.ENTER_FRAME,┬º\x01\x01\x06\x0e┬º,false,0,true);
  61.       }
  62.       
  63.       public function Reset() : *
  64.       {
  65.          ┬º\x01\x01\t\x10┬º = true;
  66.          ┬º\x01\x01\n\x01┬º = true;
  67.          SetFace("default");
  68.          ┬º\x01\x01\x02\t┬º.removeEventListener(Event.ENTER_FRAME,┬º\x01\x01\x06\x0e┬º);
  69.          ┬º\x01\x01\x02\t┬º.addEventListener(Event.ENTER_FRAME,┬º\x01\x01\x06\x0e┬º,false,0,true);
  70.       }
  71.       
  72.       public function GetHealthDamage() : int
  73.       {
  74.          return HEALTHDAMAGE;
  75.       }
  76.       
  77.       public function SetLive(param1:Boolean) : *
  78.       {
  79.          ┬º\x01\x01\n\x01┬º = param1;
  80.          if(!param1)
  81.          {
  82.             SetFace("dead");
  83.          }
  84.       }
  85.       
  86.       public function GetLive() : Boolean
  87.       {
  88.          return ┬º\x01\x01\n\x01┬º;
  89.       }
  90.       
  91.       public function GetArmorDamage() : int
  92.       {
  93.          return ARMORDAMAGE;
  94.       }
  95.       
  96.       public function GetCharScore() : int
  97.       {
  98.          return 200;
  99.       }
  100.       
  101.       private function ┬º\x01\x01\x06\x0e┬º(param1:Event) : *
  102.       {
  103.          if(┬º\x01\x01\n\x01┬º)
  104.          {
  105.             if(Math.abs(┬º\x01\x01\t\x0e┬º.x - this.x) <= ┬º\x01\x01\t\x0e┬º.width * 4 && ┬º\x01\x01\t\x10┬º)
  106.             {
  107.                SetFace("attack");
  108.                ┬º\x01\x01\t\x10┬º = false;
  109.             }
  110.             if(this.x > -100)
  111.             {
  112.                this.x -= ┬º\x01\x01\x07\x03┬º;
  113.             }
  114.             else
  115.             {
  116.                ┬º\x01\x01\t\x0f┬º.DestroyObstacle(this);
  117.             }
  118.          }
  119.          else if(this.currentLabel == "smokeend")
  120.          {
  121.             ┬º\x01\x01\t\x0f┬º.DestroyObstacle(this);
  122.          }
  123.       }
  124.       
  125.       private function SetFace(param1:String) : *
  126.       {
  127.          if(param1 == "fly")
  128.          {
  129.             gotoAndPlay("fly");
  130.          }
  131.          else if(param1 == "attack")
  132.          {
  133.             gotoAndPlay("attack");
  134.          }
  135.          else if(param1 == "dead")
  136.          {
  137.             gotoAndPlay("dead");
  138.          }
  139.          else
  140.          {
  141.             gotoAndPlay("fly");
  142.          }
  143.       }
  144.       
  145.       public function Destroy() : *
  146.       {
  147.          ┬º\x01\x01\x02\t┬º.removeEventListener(Event.ENTER_FRAME,┬º\x01\x01\x06\x0e┬º);
  148.       }
  149.    }
  150. }
  151.